package leetcode.code1716;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public class Solution2 implements IDebug {

	public int totalMoney(int n) {
		int ans = n / 7 * 28 + (n / 7) * (n / 7 - 1) * 7 / 2;
		int len = n % 7;
		int start = n / 7 + 1;
		while (len > 0) {
			ans += start++;
			len--;
		}
		return ans;
	}

	public static void main(String[] args) {
		Solution2 so = new Solution2();
		so.debug1();
		so.debug2();
		so.debug3();
		so.debug4();
	}

	@Override
	public void debug1() {
		HelpDebug.compare(96, this.totalMoney(20));

	}

	@Override
	public void debug2() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}
}
